//笔试强训: 删除公共子字符串
#include <iostream>
#include <unordered_set>
using namespace std;

int main() {
    string str1, str2;
    getline(cin, str1);
    getline(cin, str2);
    unordered_set<char> del(str2.begin(), str2.end());
    string str3;
    for(auto& e : str1)
    {
        if(del.find(e) == del.end())
        {
            str3.push_back(e);
        }
    }

    cout << str3 << endl;
}